/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.service;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.fee.entity.BillDetail;
import com.jeeplus.modules.fee.mapper.BillDetailMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 收款单子表Service
 * @author weisong
 * @version 2017-09-22
 */
@Service
@Transactional(readOnly = true)
public class BillDetailService extends CrudService<BillDetailMapper, BillDetail> {

	public BillDetail get(String id) {
		return super.get(id);
	}
	
	public List<BillDetail> findList(BillDetail billDetail) {
		return super.findList(billDetail);
	}
	
	public Page<BillDetail> findPage(Page<BillDetail> page, BillDetail billDetail) {
		return super.findPage(page, billDetail);
	}
	
	@Transactional(readOnly = false)
	public void save(BillDetail billDetail) {
		super.save(billDetail);
	}
	
	@Transactional(readOnly = false)
	public void delete(BillDetail billDetail) {
		super.delete(billDetail);
	}
	//根据收款单主表id关联收款单与收款单明细表
	public List<BillDetail> findBillDetailById(String id) {
		return mapper.findBillDetailById(id);
	}

	//根据发票子表id获取收款单子表数据
	public List<BillDetail> findAllBillDetailById(String id){
		return mapper.findAllBillDetailById(id);
	}

	//根据发票id获取收款单子表
	public List<BillDetail> findBillDetailByInvoiceId(String invoiceId, String detailId ){
		return mapper.findBillDetailByInvoiceId(invoiceId, detailId);
	}
}